import { defineStore } from 'pinia'

export const requestErrorStore = defineStore({
    id: 'requestError',
    state: () => {
        return {
            loading: false,
            error: false,
            errorText: '请求失败，点击重新加载'
        }
    },
    actions: {
        updateLoading(loading: boolean) {
            this.loading = loading
        },
        updateError(error: boolean) {
            this.error = error
        }
    }
})